<?php

quanli_require('module/base/contentHandler.class.php');

class ajax_navigation{
    public function execute() {
        global $G_PGLOB;

        if(isset($_REQUEST['operFlg']) && $_REQUEST['operFlg']>0){
            switch($_REQUEST['operFlg']){
                case 1:
                    $this->navigationList();
                    break;
            }
        }else{
            $this->toReturn('参数错误');
        }
    }


    private function navigationList(){

        global $G_PGLOB;

        $contentHandler = new contentHandler($G_PGLOB->DBCA);

        $_REQUEST['creator'] = $G_PGLOB->currentUserName;

        $result = $contentHandler->saveNavigation($_REQUEST);

        echo json_encode($result);

    }
    /**
     * 返回信息
     * @param string $message
     * @param int $code
     * @param mixed $data
     */
    private function toReturn( $message, $code = 400, $data = '' ) {

        die( json_encode( array( 'code' => $code, 'message' => $message, 'data' => $data ) ) );

    }
}